using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;

namespace p301.BO.KPO.Print
{
    public partial class PrintKpo : DevExpress.XtraReports.UI.XtraReport
    {
        public PrintKpo()
        {
            InitializeComponent();
        }

        public void Open(dsPrintKpo ds)
        {
            this.DataSource = ds;
            this.ShowPreview();
        }

        private void Detail_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            dsPrintKpo ds = (dsPrintKpo) this.DataSource;
            foreach(dsPrintKpo.dtKpoDetiRow row in ds.dtKpoDeti.Select())
            {
                switch (row.K_RODSTV_OTN)
                {
                    case 8: _lReb1.Text = row.N_REB;
                        break;
                    case 9: _lReb2.Text = row.N_REB;
                        break;
                    case 10: _lReb3.Text = row.N_REB;
                        break;
                    case 11: _lReb4.Text = row.N_REB;
                        break;
                    case 12: _lReb5.Text = row.N_REB;
                        break;
                    case 13: _lReb6.Text = row.N_REB;
                        break;
                }
            }
        }
    }
}
